import { HttpService, Injectable } from '@nestjs/common'
import { of, Observable } from 'rxjs'
import { catchError, map, timeout } from 'rxjs/operators'
@Injectable()
export class RoleService {
    constructor(private readonly httpService: HttpService) {}

    category(): Observable<any> {
        return this.httpService.get('/category').pipe(
            map(res => res.data.data),
            timeout(5000),
            catchError(error => of(`Bad Promise: ${error}`))
        )
    }
}
